-
Notifications
You must be signed in to change notification settings - Fork 7.8k
feat(sd_mmc) Make UHS-I SDR the default for ESP-P4 SD_MMC #12038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👋 Hello lbernstone, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Test Results 76 files 76 suites 15m 47s ⏱️ Results for commit b333d4c. ♻️ This comment has been updated with latest results. |
|
Please add a check for IDF versions greater than 5.3: https://github.com/espressif/arduino-esp32/actions/runs/19442524813/job/55629051409?pr=12038 |
c38ee43 to
b333d4c
Compare
|
On P4 EV Board card is no longer mounting with the changes in PR. |
|
@lbernstone If I comment out the UHS-1 flag, the sdmmc starts working again and the speed is improved with the DDR flag only. |
|
@P-R-O-C-H-Y What kind of SD card do you have? |
Its a Kingston 16GB with USH-1 marking on it. |
|
Weird is, that the SD card is not working on the P4-EYE board I got. Even with/without the changes in this PR. |
|
Can you try to format it using some SD-format tool? |
|
The P4-eye have identical SD card schema as the P4-EV board. Will try with formatted card and also with different one. |
|
Maybe also try some SDHC/SDXC card? |
|
in all cases, we want to support more cards, not less. If these options make cards not work, we need to make them optional |
|
I'm not sure if SDHC uses DDR signalling. Looking here: https://www.sdcard.org/developers/sd-standard-overview/bus-speed-default-speed-high-speed-uhs-sd-express/ |
|
I'll see if I can find some old cards around here and test an array of them. Not sure if I have really small & slow ones around any more. |
P4-eye (waveshare) has BOARD_SDMMC_POWER_PIN on 46 |
|
Hmm I took another look at the source code of this PR and host.flags &= ~SDMMC_HOST_FLAG_DDR;looks like it is disabling DDR? If it is indeed increasing the transfer speed, then it sounds like a timing issue, or maybe some signal is inverted? |
|
Hmm these defines for sure would be a lot more clear with quite a bit more comments... #define SDMMC_FREQ_DEFAULT 20000 /*!< SD/MMC Default speed (limited by clock divider) */
#define SDMMC_FREQ_HIGHSPEED 40000 /*!< SD High speed (limited by clock divider) */
#define SDMMC_FREQ_PROBING 400 /*!< SD/MMC probing speed */
#define SDMMC_FREQ_52M 52000 /*!< MMC 52MHz speed */
#define SDMMC_FREQ_26M 26000 /*!< MMC 26MHz speed */
#define SDMMC_FREQ_DDR50 50000 /*!< MMC 50MHz speed */
#define SDMMC_FREQ_SDR50 100000 /*!< MMC 100MHz speed */
#define SDMMC_FREQ_SDR104 200000 /*!< MMC 200MHz speed */The names of those defines don't appear to match the frequency numbers. Then the most important change of this PR is setting the clock? |
Description of Change
SD_MMC driver had been updated to support UHS-I on ESP-P4, but didn't have the flags quite right. This updates the driver to use UHS SDR by default.
Test Scenarios
ESP32-P4-EYE reading a file off SD card. Speed is improved about 300%.
Related links
Should close #12027